package com.esri.core.internal.tasks.a;

import com.esri.core.geometry.GeometryEngine;
import com.esri.core.geometry.Point;
import com.esri.core.geometry.SpatialReference;
import java.util.LinkedHashMap;
import java.util.Map;

/* loaded from: classes.dex */
public class f extends com.esri.core.internal.tasks.f {
    private static final long serialVersionUID = 1;
    public Point a;
    public double b;
    public SpatialReference c;
    public SpatialReference d;

    @Override // com.esri.core.internal.tasks.f
    public boolean validate() {
        return true;
    }

    @Override // com.esri.core.internal.tasks.f
    public Map<String, String> generateRequestParams() throws Exception {
        String geometryToJson;
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        SpatialReference spatialReference = this.c;
        if (spatialReference == null) {
            geometryToJson = this.a.getX() + "," + this.a.getY();
        } else {
            geometryToJson = GeometryEngine.geometryToJson(spatialReference, this.a);
        }
        linkedHashMap.put("location", geometryToJson);
        linkedHashMap.put("distance", String.valueOf(this.b));
        SpatialReference spatialReference2 = this.d;
        if (spatialReference2 != null) {
            linkedHashMap.put("outSR", String.valueOf(spatialReference2.getID()));
        }
        return linkedHashMap;
    }
}
